package com.niit.controller;

import com.niit.model.ExamPaper;
import com.niit.service.ExamPaperService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "学生模块",tags = {"学生模块"})
@RestController
public class ExamPaperController {
    @Autowired
    private ExamPaperService examPaperService;
    @ApiOperation("获得三种试卷列表")
    @GetMapping("exampaperl/{id}")
    public List<ExamPaper> list(@PathVariable("id")Long id){
        return examPaperService.getList(id);
    }
    @GetMapping("exampaperl1/{id}")
    public List<ExamPaper> list1(@PathVariable("id")Long id){
        return examPaperService.getList1(id);
    }
    @GetMapping("exampaperl2/{id}")
    public List<ExamPaper> list2(@PathVariable("id")Long id){
        return examPaperService.getList2(id);
    }

    @ApiOperation("根据ID查询不同类型试卷")
    @GetMapping("/exampaper/{id}")
    public ExamPaper getExamPaperById(@PathVariable("id")Long id){
        return examPaperService.selectExamPaperId(id); }
    @GetMapping("/exampaper1/{id}")
    public ExamPaper getExamPaperById1(@PathVariable("id")Long id){
        return examPaperService.selectExamPaperId1(id); }
    @GetMapping("/exampaper2/{id}")
    public ExamPaper getExamPaperById2(@PathVariable("id")Long id){
        return examPaperService.selectExamPaperId2(id); }


}

